package com.rainflowerstone.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @ Author     ：lwc
 * @ Date       ：Created in 11:46 2019/1/25
 * @ Description：${description}
 * @ Modified By：
 * @Version: $version$
 */
public class RainFlowerStoneFragmentPagerAdapter extends FragmentPagerAdapter {

    private int size;
    private List<Fragment> mFragmentList;

    /*获取Tab标题*/
    public RainFlowerStoneFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragmentList, int size) {
        super(fm);
        this.mFragmentList = fragmentList;
        this.size = size;
    }

    /*获取viewpage位置*/
    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    /*获取Tab集合长度，即获取有多少个Tab标题*/
    @Override
    public int getCount() {
        return size;
    }
}
